package atguigu.fansheshezhishuxing;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

public class PropertyTest {

	public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		
		ResultBody resultBody = new ResultBody();
		
		resultBody.setValueStr1("aaa");
		resultBody.setValueStr2("bbb");
		resultBody.setValueStr3("ccc");
		resultBody.setValueStr4("ddd");
		resultBody.setValueStr5("eee");
		
		ExcelBody excelBody = new ExcelBody();
		
		String name = "valueStr1";
		String property = BeanUtils.getProperty(resultBody,name);
		
//		BeanUtils.copyProperty(excelBody, name,property);
		BeanUtils.setProperty(excelBody, name,property);
		
		
		System.out.println(excelBody.getValueStr1());
	}
}
